package org.elec.mac.service;


import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import org.elec.mac.mapper.SMachineMaterialMapper;
import org.elec.mac.entity.SMachineMaterial;

import java.util.List;
import java.util.Map;

/**
 * @Description:实现类
 * @author 
 * @version 1.0
 * @created 
 */
@Service
public class SMachineMaterialService extends BaseService<SMachineMaterial,SMachineMaterialMapper> implements InitializingBean {

	@Autowired
	private SMachineMaterialMapper sMachineMaterialMapper;
	
	public void afterPropertiesSet() throws Exception {
		this.setBaseMapper(sMachineMaterialMapper);
	}

	/**
	 * 关联查询
	 * @param param
	 * @return
	 */
	public List<Map<String, Object>> getMachineMaterialList(Map<String, Object> param) {
		return sMachineMaterialMapper.getMachineMaterialList(param);
	}

	/**
	 *
	 * @param list
	 */
	public void insertMachineMaterialBatch(List<SMachineMaterial> list) {
		sMachineMaterialMapper.insertMachineMaterialBatch(list);
	}

	/**
	 *
	 * @param param
	 * @return
	 */
	public List<Long> getMachineMaterialIDList(Map<String, Object> param) {
		return sMachineMaterialMapper.getMachineMaterialIDList(param);
	}

	/**
	 * 批量删除机台原料mid
	 * @param machid
	 * @param list
	 * @return
	 */
	public int deleteMachineMaterial(Long machid, List<Long> list) {
		return sMachineMaterialMapper.deleteMachineMaterial(machid, list);
	}
}
